<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<!DOCTYPE html>
<html lang="zh-CN">
<head>

<fmt:setBundle basename="ApplicationMessage" />
<fmt:setLocale value="zh_CN" />

<%@ include file="/WEB-INF/include/meta.jsp"%>
<%@ include file="/WEB-INF/include/css.jsp"%>
<link href="${ctx.resource}/css/select2.css" rel="stylesheet">
<link href="${ctx.resource}/css/select2-bootstrap.css" rel="stylesheet">
<title>创建用户 - 租房宝金融管理平台</title>
</head>
<body>

	<%@ include file="/WEB-INF/include/header.jsp"%>

	<%@ include file="/WEB-INF/include/aside.jsp"%>
	<div class="content">
		<div class="row">
			<div class="col-sm-3">
				租约号<input type="text" name="orderNo"/>
			</div>
			<div class="col-sm-2">
				<button class="btn btn-primary" id="sendSms"
					style="text-align: center;">发送</button>
			</div>
		</div>
		<%@ include file="/WEB-INF/include/footer.jsp"%>
		 <div class="modal fade in bs-example-modal-sm" id="dialog" role="dialog" tabindex="-1" aria-labelledby="dialoglabel" aria-hidden="true">
		<div class="modal-dialog">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close close-dialog" aria-label="关闭" ><span aria-hidden="true">&times;</span></button>
					<h4 class="modal-title" id="dialoglabel">提示</h4>
				</div>
				<div class="modal-body">
					<p></p>
				</div>
				<div class="modal-footer">
					<button type="button" class="btn btn-default close-dialog">关闭</button>
				</div>
			</div>
		</div>
	  </div>
	</div>

	<%@ include file="/WEB-INF/include/script.jsp"%>
	<script src="${ctx.resource}/js/bootstrap-switch.min.js"></script>
	<script src="${ctx.resource}/js/bootstrap-modal-trigger.js"></script>
	<script src="${ctx.resource}/js/bootstrap.validate.js"></script>
	<script src="${ctx.resource}/js/bootstrap.validate.en.js"></script>
	<script src="${ctx.resource}/js/bootstrap-alert-fade-trigger.js"></script>
	<script>
	
		$("#sendSms").click(function(){
			
			var orderNo = $('input[name="orderNo"]').val();
			
			if(orderNo == "" || orderNo.length <= 0){
				
				resultHandler('订单号不能为空！',false);
				
				return false;
			}
			
			$.post('${ctx}/do-rent-notify',{
				orderNo : orderNo
			},function(data){
				
				resultHandler($.parseJSON(data).message,true);
			})
			
		})
		var resultHandler = function(message,isReload){
			 
			 $('#dialog').find('p').text(message).end().modal();
			 
			 $('#dialog .close-dialog').click(function(){
				 
				 $('#dialog').modal('hide');
				 
				 if(isReload){
				 
					 window.location.reload();
				};
			
			 });
		 };
	</script>
</body>
</html>